Practical Linux with Raspberry Pi OS by Ashwin Pajankar

Practical Linux with Raspberry Pi OS by Ashwin Pajankar

Author:Ashwin Pajankar [Pajankar, Ashwin]
Language: eng
Format: epub
ISBN: 9781484265109
Publisher: Apress


Control Operators

Let us see a few control operators. Unix and derivatives have many control operators. Let us learn them one by one.

Run the following commands in sequence:ls

echo $?

The last command returns 0. This is because $? stores the exit code of execution of the last command. If it is a success, it stores 0 and otherwise other code.

We can separate two commands with a semicolon (;) as follows:echo test1 ; echo test2

Let us see the usage of the operator &. When a line ends with it, the shell does not wait for the command to finish execution. We get the shell prompt back.

Open the lxterminal program in GUI or using VNC. Then run the command leafpad to open the text editor. You will notice that as long as the editor is running, the command prompt is locked and not running typed-in commands. Once we close the editor, it will run those commands one by one (they are actually stored in a buffer). If we run the following commandleafpad &



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.